package com.ruoyi.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.platform.annotation.Excel;
import com.ruoyi.platform.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.ArrayList;
import java.util.List;

/**
 * 文档目录对象 tp_document_category
 *
 * @author tp
 * @date 2022-11-02
 */
@ApiModel(value = "文档目录对象 tp_document_category", description = "tp_document_category业务表")
@TableName("tp_document_category")
public class DocumentCategory extends BaseEntity<DocumentCategory> {

    private static final long serialVersionUID = 1L;

    /**
     * 目录ID
     */
    @ApiModelProperty(value = "主键")
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 文档ID
     */
    @Excel(name = "文档ID")
    @ApiModelProperty(value = "文档ID")
    private Long documentId;

    /**
     * 目录名
     */
    @Excel(name = "目录名")
    @ApiModelProperty(value = "目录名")
    private String categoryName;

    /**
     * 目录类型
     */
    @Excel(name = "目录类型")
    @ApiModelProperty(value = "目录类型")
    private Integer categoryType;

    /**
     * 父ID
     */
    @Excel(name = "父ID")
    @ApiModelProperty(value = "父ID")
    private Long parentId;

    /**
     * 祖级列表
     */
    @Excel(name = "祖级列表")
    @ApiModelProperty(value = "祖级列表")
    private String ancestors;

    /**
     * 删除标志
     */
    private Integer delFlag;


    /**
     * 树节点可用状态
     */
    @TableField(exist = false)
    private String status;

    /**
     * 文档类型后缀
     */
    @TableField(exist = false)
    private String type;

    @TableField(exist = false)
    private Integer isRoot;

    public Integer getIsRoot() {
        return isRoot;
    }

    public void setIsRoot(Integer isRoot) {
        this.isRoot = isRoot;
    }

    /**
     * 子部门
     */
    @TableField(exist = false)
    private List<DocumentCategory> children = new ArrayList<>();

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }


    public List<DocumentCategory> getChildren() {
        return children;
    }

    public void setChildren(List<DocumentCategory> children) {
        this.children = children;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setDocumentId(Long documentId) {
        this.documentId = documentId;
    }

    public Long getDocumentId() {
        return documentId;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryType(Integer categoryType) {
        this.categoryType = categoryType;
    }

    public Integer getCategoryType() {
        return categoryType;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setAncestors(String ancestors) {
        this.ancestors = ancestors;
    }

    public String getAncestors() {
        return ancestors;
    }

    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
    }

    public Integer getDelFlag() {
        return delFlag;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("documentId", getDocumentId())
                .append("categoryName", getCategoryName())
                .append("categoryType", getCategoryType())
                .append("parentId", getParentId())
                .append("ancestors", getAncestors())
                .append("delFlag", getDelFlag())
                .append("createTime", getCreateTime())
                .append("createBy", getCreateBy())
                .append("updateTime", getUpdateTime())
                .append("updateBy", getUpdateBy())
                .append("status", getStatus())
                .toString();
    }
}
